<?php

declare(strict_types=1);

namespace App\Chat\Helpers;

use App\Common\Constants\JwtAuthSceneConstants;
use Mine\Helper\LoginUser;

class ChatLoginUser extends LoginUser
{
    public function __construct(string $scene = JwtAuthSceneConstants::CUSTOMER_SERVICE)
    {
        parent::__construct($scene);
    }

    public function getUsername(): string
    {
        return $this->jwt->getParserData()['name'] ?? '';
    }

    /**
     * 是否超级管理员 默认是
     * @return bool
     */
    public function isSuperAdmin(): bool
    {
//        $userInfo = $this->getUserInfo();
//        if($userInfo['parent_id'] == 0){
//            return true;
//        }else{
//            return false;
//        }
        return true;
    }
}